# # 处理ex
# import pandas as pd
#
# df = pd.read_excel(r'C:\Users\Administrator\Desktop\111.xlsx')
# print(df)
#
# # 写文件到excel
# a1 = {'name': 'xiaohong', 'age': 20}
# a2 = {'name': 'xiaoliw', 'age': 22}
# a3 = {'name': 'xiaoabi', 'age': 21}
# l1 = [a1, a2, a3]
# print(l1)
# # 需要将列表变成DataFrame格式
# df1 = pd.DataFrame(l1)
# print(df1)
# # 使用pandas的函数to_excel(), index索引 False(取消表头)
# df1.to_excel('222.xlsx', index=False)

from docx import Document
doc = Document(r'C:\Users\Administrator\Desktop\2023年国务院政府工作报告.docx')
print(doc)
p = doc.paragraphs
print(p)
print(len(p))
for i in p:
    print(i.text)
